<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>psychsim.pwl.TreeDistribution</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="psychsim.world.World-class.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://pynadath.net:81/projects/psychsim">PsychSim</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="psychsim-module.html">Package&nbsp;psychsim</a> ::
        <a href="psychsim.pwl-module.html">Module&nbsp;pwl</a> ::
        Class&nbsp;TreeDistribution
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="psychsim.pwl.TreeDistribution-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class TreeDistribution</h1><p class="nomargin-top"><span class="codelink"><a href="psychsim.pwl-pysrc.html#TreeDistribution">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_psychsim_7" name="uml_class_diagram_for_psychsim_7">
<area shape="rect" id="node16" href="psychsim.pwl.TreeDistribution-class.html#element2xml" title="psychsim.pwl.TreeDistribution.element2xml" alt="" coords="29,729,205,748"/>
<area shape="rect" id="node16" href="psychsim.pwl.TreeDistribution-class.html#xml2element" title="psychsim.pwl.TreeDistribution.xml2element" alt="" coords="29,748,205,767"/>
<area shape="rect" id="node1" href="psychsim.pwl.TreeDistribution-class.html" title="A class representing a Distribution over KeyedTree instances" alt="" coords="17,697,217,773"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#epsilon" title="psychsim.probability.Distribution.epsilon" alt="" coords="17,369,217,388"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#__init__" title="x.__init__(...) initializes x; see help(type(x)) for signature" alt="" coords="17,391,217,409"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#__getitem__" title="x[y]" alt="" coords="17,409,217,428"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#__setitem__" title="x[i]=y" alt="" coords="17,428,217,447"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#__delitem__" title="del x[y]" alt="" coords="17,447,217,465"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#clear" title="Remove all items from D." alt="" coords="17,465,217,484"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#replace" title="Replaces on element in the sample space with another." alt="" coords="17,484,217,503"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#domain" title="Returns: &#160;the sample space of this probability distribution" alt="" coords="17,503,217,521"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#normalize" title="Normalizes the distribution so that the sum of values = 1" alt="" coords="17,521,217,540"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#expectation" title="Returns: &#160;the expected value of this distribution" alt="" coords="17,540,217,559"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#sample" title="Returns: &#160;an element from this domain, with a sample probability given by this &#160;distribution" alt="" coords="17,559,217,577"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#set" title="Reduce distribution to be 100% for the given element" alt="" coords="17,577,217,596"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#select" title="Reduce distribution to a single element, sampled according to the given &#160;distribution" alt="" coords="17,596,217,615"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#__add__" title="psychsim.probability.Distribution.__add__" alt="" coords="17,615,217,633"/>
<area shape="rect" id="node17" href="psychsim.probability.Distribution-class.html#__copy__" title="psychsim.probability.Distribution.__copy__" alt="" coords="17,652,217,671"/>
<area shape="rect" id="node2" href="psychsim.probability.Distribution-class.html" title="A probability distribution" alt="" coords="5,345,229,677"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="cmp(x,y)" alt="" coords="57,39,177,57"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="dict.__contains__" alt="" coords="57,57,177,76"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="x==y" alt="" coords="57,76,177,95"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="x&gt;=y" alt="" coords="57,95,177,113"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="x.__getattribute__(&#39;name&#39;) &lt;==&gt; x.name" alt="" coords="57,113,177,132"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="x&gt;y" alt="" coords="57,132,177,151"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="iter(x)" alt="" coords="57,151,177,169"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="x&lt;=y" alt="" coords="57,169,177,188"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="len(x)" alt="" coords="57,188,177,207"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="x&lt;y" alt="" coords="57,207,177,225"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="x!=y" alt="" coords="57,225,177,244"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="dict.__new__" alt="" coords="57,244,177,263"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="repr(x)" alt="" coords="57,263,177,281"/>
<area shape="rect" id="node18" href="javascript:void(0);" title="dict.viewvalues" alt="" coords="57,300,177,319"/>
<area shape="rect" id="node3" href="javascript:void(0);" title="dict() &#45;&gt; new empty dictionary dict(mapping) &#45;&gt; new dictionary initialized from a mapping object&#39;s (key, value) pairs dict(iterable) &#45;&gt; new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) &#45;&gt; new dictionary initialized with the name=value pairs in the keyword argument list." alt="" coords="45,6,189,325"/>
</map>
  <img src="uml_class_diagram_for_psychsim_7.gif" alt='' usemap="#uml_class_diagram_for_psychsim_7" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>A class representing a <a 
  href="psychsim.probability.Distribution-class.html" 
  class="link">Distribution</a> over <a 
  href="psychsim.pwl.KeyedTree-class.html" class="link">KeyedTree</a> 
  instances</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.pwl.TreeDistribution-class.html#element2xml" class="summary-sig-name">element2xml</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">value</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.pwl-pysrc.html#TreeDistribution.element2xml">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.pwl.TreeDistribution-class.html#xml2element" class="summary-sig-name">xml2element</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">key</span>,
        <span class="summary-sig-arg">node</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.pwl-pysrc.html#TreeDistribution.xml2element">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="psychsim.probability.Distribution-class.html">probability.Distribution</a></code></b>:
      <code><a href="psychsim.probability.Distribution-class.html#__add__">__add__</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#__copy__">__copy__</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#__delitem__">__delitem__</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#__getitem__">__getitem__</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#__hash__">__hash__</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#__init__">__init__</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#__setitem__">__setitem__</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#__str__">__str__</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#__sub__">__sub__</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#__xml__">__xml__</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#clear">clear</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#domain">domain</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#expectation">expectation</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#normalize">normalize</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#parse">parse</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#replace">replace</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#sample">sample</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#select">select</a></code>,
      <code><a href="psychsim.probability.Distribution-class.html#set">set</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>dict</code></b>:
      <code>__cmp__</code>,
      <code>__contains__</code>,
      <code>__eq__</code>,
      <code>__ge__</code>,
      <code>__getattribute__</code>,
      <code>__gt__</code>,
      <code>__iter__</code>,
      <code>__le__</code>,
      <code>__len__</code>,
      <code>__lt__</code>,
      <code>__ne__</code>,
      <code>__new__</code>,
      <code>__repr__</code>,
      <code>__sizeof__</code>,
      <code>copy</code>,
      <code>fromkeys</code>,
      <code>get</code>,
      <code>has_key</code>,
      <code>items</code>,
      <code>iteritems</code>,
      <code>iterkeys</code>,
      <code>itervalues</code>,
      <code>keys</code>,
      <code>pop</code>,
      <code>popitem</code>,
      <code>setdefault</code>,
      <code>update</code>,
      <code>values</code>,
      <code>viewitems</code>,
      <code>viewkeys</code>,
      <code>viewvalues</code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__setattr__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Class Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-ClassVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="psychsim.probability.Distribution-class.html">probability.Distribution</a></code></b>:
      <code><a href="psychsim.probability.Distribution-class.html#epsilon">epsilon</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="element2xml"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">element2xml</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">value</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.pwl-pysrc.html#TreeDistribution.element2xml">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Overrides:
        <a href="psychsim.probability.Distribution-class.html#element2xml">probability.Distribution.element2xml</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="xml2element"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">xml2element</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">key</span>,
        <span class="sig-arg">node</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.pwl-pysrc.html#TreeDistribution.xml2element">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Overrides:
        <a href="psychsim.probability.Distribution-class.html#xml2element">probability.Distribution.xml2element</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="psychsim.world.World-class.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://pynadath.net:81/projects/psychsim">PsychSim</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed Oct 24 21:38:10 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
